home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / doc / intro.man < prev    next >
Encoding:
Text File  |  1992-11-14  |  6.6 KB  |  193 lines

  1. /*man-start*********************************************************************
  2.  
  3.  
  4.  
  5.         Introduction to XSI Curses Interface
  6.  
  7.  
  8.  
  9. The X/Open Group has identified a strong need for a generic terminal
  10.  
  11. interface for applications that wish to be independent of terminal
  12.  
  13. hardware and connection method.
  14.  
  15.  
  16.  
  17. This interface should allow the attachment of character and
  18.  
  19. block-oriented terminals.  Furthermore, it should not put any
  20.  
  21. constraints on how the terminals are attached (e.g., Local Area
  22.  
  23. Networks, PADs on X.25, etc.). 
  24.  
  25.  
  26.  
  27. The curses library interfaces provides the user with a method of
  28.  
  29. updating screens with reasonable optimisation. 
  30.  
  31.  
  32.  
  33. The X/Open group has found it impossible to define a totally portable
  34.  
  35. set of curses interface routines that cover asynchronous, networked,
  36.  
  37. and synchronous terminals.  The functions are oriented towards locally
  38.  
  39. connected asynchronous terminals.  For such terminals, applications
  40.  
  41. conforming to this interface are portable.  The interface routines
  42.  
  43. curses may, however, also be used with synchronous and networked
  44.  
  45. terminals, provided the restrictions below are considered. 
  46.  
  47.  
  48.  
  49. These functions have been included been included in the X/Open
  50.  
  51. definition in the "optional" category.  This means that although they
  52.  
  53. are likely to appear on many X/Open compliant systems, they are not
  54.  
  55. guaranteed to be on all systems.  Where they are supported, they will
  56.  
  57. conform to the given definition. 
  58.  
  59.  
  60.  
  61.  
  62.  
  63. ----------------------------------------------------------------------
  64.  
  65.  
  66.  
  67.         Synchronous and Networked Asynchronous Terminals
  68.  
  69.  
  70.  
  71. These notes indicate to the application writer some considerations to
  72.  
  73. be borne in mind when driving synchronous, networked asynchronous
  74.  
  75. (NWA) or non-standard directly connected asynchronous terminals.
  76.  
  77.  
  78.  
  79. Such terminals are often used in a mainframe environment and
  80.  
  81. communicatie to the host in block mode.  That is, the user types
  82.  
  83. characters at the terminal then presses a special key to initiate
  84.  
  85. transmission of the characters to the host. 
  86.  
  87.  
  88.  
  89. Frequently, although it may be possible to send arbitrary sized blocks
  90.  
  91. to the host, it may not be possible or desireable to cause a character
  92.  
  93. to be transmitted with only a single keystroke. 
  94.  
  95.  
  96.  
  97. This can cause severe problems to an application wishing to make use
  98.  
  99. of single character input. 
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107. OUTPUT
  108.  
  109.  
  110.  
  111. The curses package can be used in the normal way for all operations
  112.  
  113. pertaining to output to the terminal, with the possible exception that
  114.  
  115. on some terminals the refresh() routine may have to redraw the entire
  116.  
  117. screen contents in order to perform any update.
  118.  
  119.  
  120.  
  121. If it is additionally necessary to clear the screen before each such
  122.  
  123. operation, the result could be unacceptable. 
  124.  
  125.  
  126.  
  127.  
  128.  
  129. INPUT
  130.  
  131.  
  132.  
  133. Because of the nature of operation of synchronous (block-mode) and NWA
  134.  
  135. terminals, it may not be possible to support all or any of the curses
  136.  
  137. input functions.  In particular, the following points should be noted:
  138.  
  139.  
  140.  
  141. * Single-character input may not be possible.  It may be necessary to
  142.  
  143.   press a special key to cause all characters typed at the terminal to
  144.  
  145.   be transmitted to the host. 
  146.  
  147.  
  148.  
  149. * It may not be possibel to disable echo.  Character echo may be performed
  150.  
  151.   directly by the terminal.  On terminals that behave this way, any curses
  152.  
  153.   application that performs input should be aware that any characters
  154.  
  155.   type will appear on the screen wherever the cursor is positioned.
  156.  
  157.   This may not necessarily correspond to the position of the cursor in
  158.  
  159.   the window.
  160.  
  161.  
  162.  
  163.  
  164.  
  165. ----------------------------------------------------------------------
  166.  
  167.  
  168.  
  169.         Data Types and the <curses.h> Header
  170.  
  171.  
  172.  
  173. The data types supported by curses are described in this section.
  174.  
  175.  
  176.  
  177. As the library supports a procedural interface to the data types,
  178.  
  179. actual structure contents are not described.  All curses data are
  180.  
  181. manipulated using the routines provided. 
  182.  
  183.  
  184.  
  185.  
  186.  
  187. THE <curses.h> HEADER
  188.  
  189.  
  190.  
  191. The <curses.h> header defines various constants and declares the data types
  192.  
  193. that are available to the application.
  194.  
  195.  
  196.  
  197.  
  198.  
  199. DATA TYPES
  200.  
  201.  
  202.  
  203. The following data types are declared:
  204.  
  205.  
  206.  
  207.     WINDOW*        pointer to screen representation
  208.  
  209.     SCREEN*        pointer to terminal descriptor
  210.  
  211.     bool        boolean data type
  212.  
  213.     chtype        representation of a character in a window
  214.  
  215.  
  216.  
  217. The actual WINDOW and SCREEN objects used to store information are
  218.  
  219. created by the corresponding routiens and a pointer to them is
  220.  
  221. provided.  All manipulation is through that pointer. 
  222.  
  223.  
  224.  
  225.  
  226.  
  227. CONSTANTS
  228.  
  229.  
  230.  
  231. The following constants are defined. 
  232.  
  233.  
  234.  
  235.  
  236.  
  237. GENERAL
  238.  
  239.  
  240.  
  241.     COLS        number of columns on terminal screen
  242.  
  243.     ERR        value returned on error condition
  244.  
  245.     FALSE        boolean false value
  246.  
  247.     LINES        number of lines on terminal screen
  248.  
  249.     OK        value returned on successful completion
  250.  
  251.     NULL        zero pointer value
  252.  
  253.     TRUE        boolean true value
  254.  
  255.  
  256.  
  257. VIDEO ATTRIBUTES
  258.  
  259.  
  260.  
  261.     A_BLINK        blinking
  262.  
  263.     A_BOLD        extra bright or bold
  264.  
  265.     A_DIM        half bright
  266.  
  267.     A_REVERSE    reverse video
  268.  
  269.     A_STANDOUT    terminal's best highlighting mode
  270.  
  271.     A_UNDERLINE    underlining
  272.  
  273.     A_ATTRIBUTES    bit-mask to extract attributes
  274.  
  275.     A_CHARTEXT    bit-mask to extract a character
  276.  
  277.  
  278.  
  279. Normally, attributres are a property of the character. 
  280.  
  281.  
  282.  
  283.  
  284.  
  285. INPUT VALUES
  286.  
  287.  
  288.  
  289. The following constants might be returned by getch() if keypad() has
  290.  
  291. been enabled.  Note that not all of these may be supported on a
  292.  
  293. particular terminal if the terminal does not transmit a unique code
  294.  
  295. when the key is pressed or the definition for the key is not present
  296.  
  297. in the underlying table of terminal capabilities. 
  298.  
  299.  
  300.  
  301.     KEY_BREAK    break key
  302.  
  303.     KEY_DOWN    the four arrow keys
  304.  
  305.     KEY_UP
  306.  
  307.     KEY_LEFT
  308.  
  309.     KEY_RIGHT
  310.  
  311.     KEY_HOME    home key (upward+left arrow)
  312.  
  313.     KEY_BACKSPACE    backspace
  314.  
  315.     KEY_F0        function keys; space for 64 keys is reserved
  316.  
  317.     KEY_F(n)    (KEY_F0+(n))
  318.  
  319.     KEY_DL        delete line
  320.  
  321.     KEY_IL        insert line
  322.  
  323.     KEY_DC        delete character
  324.  
  325.     KEY_IC        insert character
  326.  
  327.     KEY_EIC        exit insert character mode
  328.  
  329.     KEY_CLEAR    clear screen
  330.  
  331.     KEY_EOS        clear to end of screen
  332.  
  333.     KEY_EOL        clear to end of line
  334.  
  335.     KEY_SF        scroll 1 line forwards
  336.  
  337.     KEY_SR        scroll 1 line backwards (reverse)
  338.  
  339.     KEY_NPAGE    next page
  340.  
  341.     KEY_PPAGE    previous page
  342.  
  343.     KEY_STAB    set tab
  344.  
  345.     KEY_CTAB    clear tab
  346.  
  347.     KEY_CATAB    clear all tabs
  348.  
  349.     KEY_ENTER    enter or send
  350.  
  351.     KEY_SRESET    soft (partial) reset
  352.  
  353.     KEY_RESET    reset or hard reset
  354.  
  355.     KEY_PRINT    print or copy
  356.  
  357.     KEY_LL        home down or bottom (lower left)
  358.  
  359.     KEY_A1        upper left of virtual keypad
  360.  
  361.     KEY_A3        upper right of virtual keypad
  362.  
  363.     KEY_B2        centre of virtual keypad
  364.  
  365.     KEY_C1        lower left of virtual keypad
  366.  
  367.     KEY_C3        lower right of virtual keypad
  368.  
  369.  
  370.  
  371. The virtual keypad is arranged like this:
  372.  
  373.  
  374.  
  375.     A1    up    A3
  376.  
  377.     left    B2    right
  378.  
  379.     C1    down    C3
  380.  
  381.  
  382.  
  383. **man-end**********************************************************************/
  384.  
  385.